package com.ryan.demo.path.utils;

import static org.junit.Assert.fail;

import java.net.URL;

import org.apache.log4j.Logger;
import org.junit.Test;
import org.springframework.util.Assert;

public class PathDemo {
	private final Logger logger = Logger.getLogger(this.getClass());

	
	@Test
	public void testGetUrlByClass() {
		URL url = PathDemo.getUrlByClass(this.getClass());
		logger.debug(url.toString());
		Assert.notNull(url);		
	}

	@Test
	public void testGetClassPathByClass() {
		fail("Not yet implemented");
	}

	@Test
	public void testGetRealPathByClass() {
		fail("Not yet implemented");
	}
	
	
	public static URL getUrlByClass(Class<?> theClass){
		return theClass.getResource("");
	}
	public static String getClassPathByClass(Class<?> theClass){
		return theClass.getResource("/").getPath();
	}
	public static String getRealPathByClass(Class<?> theClass){
		return theClass.getResource("").getPath();
	}

}
